package com.cl.spark.enums;

import lombok.Getter;


@Getter
public enum SparkNodeEnum {
    DEFAULT("default", "默认", ""),
    HTTP_REQUEST("/other/httpRequest", "请求接口", "{\"name\":{\"label\":\"名称\",\"dataType\":\"String\",\"inputType\":\"Input\"},\"url\":{\"label\":\"请求地址\",\"dataType\":\"String\",\"inputType\":\"Input\"},\"method\":{\"label\":\"请求类型\",\"dataType\":\"String\",\"inputType\":\"Select\",\"dataEnum\":[\"POST\",\"GET\"]},\"paramTemplate\":{\"label\":\"参数模板\",\"dataType\":\"String\",\"inputType\":\"Input\"},\"resultPosition\":{\"label\":\"结果位置\",\"dataType\":\"String\",\"inputType\":\"Input\"},\"returnTemplate\":{\"label\":\"返回值样例\",\"dataType\":\"String\",\"inputType\":\"TextArea\"}}"),
    HTTP_REQUEST_EXECUTE("/other/httpRequestExecute", "接口输出", "{\"name\":{\"label\":\"名称\",\"dataType\":\"String\",\"inputType\":\"Input\"},\"url\":{\"label\":\"请求地址\",\"dataType\":\"String\",\"inputType\":\"Input\"},\"method\":{\"label\":\"请求类型\",\"dataType\":\"String\",\"inputType\":\"Select\",\"dataEnum\":[\"POST\",\"GET\"]},\"interval\":{\"label\":\"间隔(毫秒)\",\"dataType\":\"String\",\"inputType\":\"Input\"},\"requestMaxCount\":{\"label\":\"每日请求上限\",\"dataType\":\"String\",\"inputType\":\"Input\"},\"param\":{\"label\":\"JSON参数\",\"dataType\":\"String\",\"inputType\":\"Input\"}}"),
    JOIN("/base/join", "连接", "{\"name\":{\"label\":\"名称\",\"dataType\":\"String\",\"inputType\":\"Input\"},\"joinType\":{\"label\":\"连接方式\",\"dataType\":\"String\",\"inputType\":\"Select\",\"dataEnumFixed\":\"true\",\"dataEnum\":[\"内连接\",\"全外连接\",\"左连接\",\"右连接\",\"半左连接\",\"左反连接\",\"右反连接\"]},\"fields1\":{\"label\":\"连接字段1\",\"dataType\":\"List\",\"inputType\":\"Select\",\"source\":\"getFields1\"},\"fields2\":{\"label\":\"连接字段2\",\"dataType\":\"List\",\"inputType\":\"Select\",\"source\":\"getFields2\"},\"fieldAppendTableNameFlag\":{\"label\":\"字段追加表名\",\"dataType\":\"String\",\"inputType\":\"Switch\",\"dataEnumFixed\":\"true\",\"dataEnum\":[\"否\",\"是\"]}}"),
    UNION("/base/union", "合并", "{\"name\":{\"label\":\"名称\",\"dataType\":\"String\",\"inputType\":\"Input\",\"data\":\"\"},\"fieldAppendTableNameFlag\":{\"label\":\"字段追加表名\",\"dataType\":\"String\",\"inputType\":\"Switch\",\"dataEnumFixed\":\"true\",\"dataEnum\":[\"否\",\"是\"]}}"),
    MORE_INPUT_UNION("/base/moreInputUnion", "多输入合并", "{\"name\":{\"label\":\"名称\",\"dataType\":\"String\",\"inputType\":\"Input\",\"data\":\"\"},\"fieldAppendTableNameFlag\":{\"label\":\"字段追加表名\",\"dataType\":\"String\",\"inputType\":\"Switch\",\"dataEnumFixed\":\"true\",\"dataEnum\":[\"否\",\"是\"]}}"),
    UNION_TABLE("/base/unionTable", "合并表", "{\"name\":{\"label\":\"名称\",\"dataType\":\"String\",\"inputType\":\"Input\",\"data\":\"\"},\"fieldAppendTableNameFlag\":{\"label\":\"字段追加表名\",\"dataType\":\"String\",\"inputType\":\"Switch\",\"dataEnumFixed\":\"true\",\"dataEnum\":[\"否\",\"是\"]}}"),
    SORT("/base/sort", "排序", "{\"name\":{\"label\":\"名称\",\"dataType\":\"String\",\"inputType\":\"Input\"},\"fields\":{\"label\":\"排序字段\",\"dataType\":\"List\",\"dataItem\":{\"label\":\"字段\",\"dataType\":\"Object\",\"itemTemplate\":{\"fieldName\":{\"label\":\"字段名\",\"dataType\":\"String\",\"inputType\":\"Select\",\"source\":\"getFields\"},\"sortOrder\":{\"label\":\"排序方式\",\"dataType\":\"String\",\"inputType\":\"Select\",\"dataEnum\":[\"正序\",\"倒序\"]}},\"inputType\":\"Card\"},\"inputType\":\"DynamicSort\"}}"),
    DROP_DUPLICATES("/base/dropDuplicates", "去重", "{\"name\":{\"label\":\"名称\",\"dataType\":\"String\",\"inputType\":\"Input\"},\"fields\":{\"label\":\"去重字段\",\"dataType\":\"List\",\"inputType\":\"Select\",\"source\":\"getFields\"}}"),
    CLONE_COLUMN("/base/cloneColumn", "克隆字段", "{\"name\":{\"label\":\"名称\",\"dataType\":\"String\",\"inputType\":\"Input\"},\"cloneFields\":{\"label\":\"克隆字段\",\"dataType\":\"List\",\"inputType\":\"Select\",\"source\":\"getFields\"},\"targetField\":{\"label\":\"目标字段\",\"dataType\":\"String\",\"inputType\":\"Input\"}}"),
    GROUP_DROP_DUPLICATES("/base/groupDropDuplicates", "分组去重", "{\"name\":{\"label\":\"名称\",\"dataType\":\"String\",\"inputType\":\"Input\"},\"groupByFields\":{\"label\":\"分组字段\",\"dataType\":\"List\",\"inputType\":\"Select\",\"source\":\"getFields\"},\"sortFields\":{\"label\":\"排序字段\",\"dataType\":\"List\",\"inputType\":\"Select\",\"source\":\"getFields\"},\"sortType\":{\"label\":\"排序类型\",\"dataType\":\"String\",\"inputType\":\"Select\",\"dataEnumFixed\":\"true\",\"dataEnum\":[\"DESC\",\"ASC\"],\"value\":\"\"},\"reserveCount\":{\"label\":\"保留数量\",\"dataType\":\"String\",\"inputType\":\"Input\"}}"),
    STRING("/base/string", "字符串", "{\"name\":{\"label\":\"名称\",\"dataType\":\"String\",\"inputType\":\"Input\"},\"fields\":{\"label\":\"过滤字段\",\"dataType\":\"List\",\"inputType\":\"Select\",\"source\":\"getFields\"},\"filterFunction\":{\"label\":\"过滤方法\",\"dataType\":\"String\",\"inputType\":\"Select\",\"dataEnumFixed\":\"true\",\"dataEnum\":[\"大于\",\"小于\",\"等于\",\"大于等于\",\"小于等于\",\"包含\",\"列表包含(或)\"],\"value\":\"\"},\"filterValue\":{\"label\":\"值\",\"dataType\":\"String\",\"inputType\":\"Input\"}}"),
    COMPUTE(
            "/base/computeNumber",
            "数值计算",
            "{\"name\":{\"label\":\"名称\",\"dataType\":\"String\",\"inputType\":\"Input\"},\"fields\":{\"label\":\"计算字段\",\"dataType\":\"List\",\"inputType\":\"Select\",\"source\":\"getFields\"},\"resultFields\":{\"label\":\"结果字段\",\"dataType\":\"List\",\"inputType\":\"Select\",\"source\":\"getFields\"},\"computeFunction\":{\"label\":\"计算方法\",\"dataType\":\"String\",\"inputType\":\"Select\",\"dataEnumFixed\":\"true\",\"dataEnum\":[\"加\",\"减\",\"乘\",\"除以\",\"取余\",\"绝对值\",\"平方根\",\"幂运算\",\"取整\",\"取顶\",\"取小数部分\",\"非空字符数\",\"截取前N位\",\"去除两侧空字符\",\"取最小地址单位\",\"去除括号值后提取中英文和数字\"],\"value\":\"\"},\"computeValue\":{\"label\":\"值\",\"dataType\":\"String\",\"inputType\":\"Input\"}}"),

    APPEND_FIXED_VALUE("/base/appendFixedValue", "追加固定值", "{\"name\":{\"dataType\":\"String\",\"inputType\":\"Input\",\"label\":\"名称\",\"value\":\"追加固定值\"},\"fields\":{\"dataType\":\"List\",\"inputType\":\"Select\",\"label\":\"字段\",\"value\":\"\",\"source\":\"getFields\"},\"fixedValue\":{\"dataType\":\"String\",\"inputType\":\"Input\",\"label\":\"固定值\",\"value\":\"\"}}"),
    APPEND_COLUMN_VALUE("/base/appendColumnValue", "追加字段值", "{\"name\":{\"dataType\":\"String\",\"inputType\":\"Input\",\"label\":\"名称\",\"value\":\"追加字段值\"},\"fields\":{\"dataType\":\"List\",\"inputType\":\"Select\",\"label\":\"字段\",\"value\":\"\",\"source\":\"getFields\"},\"columnName\":{\"dataType\":\"String\",\"inputType\":\"Input\",\"label\":\"字段名\",\"value\":\"\"}}"),
    MATCH("/statistics/match", "匹配", "{\"name\":{\"label\":\"名称\",\"dataType\":\"String\",\"inputType\":\"Input\"},\"fields1\":{\"label\":\"匹配字段1\",\"dataType\":\"List\",\"inputType\":\"Select\",\"source\":\"getFields1\"},\"fields2\":{\"label\":\"匹配字段2\",\"dataType\":\"List\",\"inputType\":\"Select\",\"source\":\"getFields2\"},\"outputType\":{\"label\":\"输出类型\",\"dataType\":\"String\",\"inputType\":\"Select\",\"dataEnumFixed\":\"true\",\"dataEnum\":[\"全部\",\"匹配\",\"不匹配\"],\"value\":\"匹配\"},\"matchType\":{\"label\":\"匹配类型\",\"dataType\":\"String\",\"inputType\":\"Select\",\"dataEnumFixed\":\"true\",\"dataEnum\":[\"完全匹配\",\"模糊匹配\"],\"value\":\"完全匹配\"}}"),

    FILTER_DATE("/statistics/filterDate", "日期过滤", "{\"name\":{\"label\":\"名称\",\"dataType\":\"String\",\"inputType\":\"Input\"},\"fields\":{\"label\":\"过滤字段\",\"dataType\":\"List\",\"inputType\":\"Select\",\"source\":\"getFields\"},\"filterFunction\":{\"label\":\"过滤方法\",\"dataType\":\"String\",\"inputType\":\"Select\",\"dataEnumFixed\":\"true\",\"dataEnum\":[\"大于\",\"小于\",\"等于\",\"不等于\",\"大于等于\",\"小于等于\"],\"value\":\"\"},\"filterValue\":{\"label\":\"值\",\"dataType\":\"String\",\"inputType\":\"Input\"},\"fields2\":{\"label\":\"过滤字段2\",\"dataType\":\"List\",\"inputType\":\"Select\",\"source\":\"getFields\"}}"),

    FILTER("/statistics/filter", "过滤", "{\"name\":{\"label\":\"名称\",\"dataType\":\"String\",\"inputType\":\"Input\"},\"fields\":{\"label\":\"过滤字段\",\"dataType\":\"List\",\"inputType\":\"Select\",\"source\":\"getFields\"},\"logicalOperator\":{\"label\":\"多字段逻辑运算符\",\"dataType\":\"String\",\"inputType\":\"Select\",\"dataEnumFixed\":\"true\",\"dataEnum\":[\"OR\",\"AND\"],\"value\":\"\"},\"filterFunction\":{\"label\":\"过滤方法\",\"dataType\":\"String\",\"inputType\":\"Select\",\"dataEnumFixed\":\"true\",\"dataEnum\":[\"大于\",\"小于\",\"等于\",\"大于等于\",\"小于等于\",\"包含\",\"不包含\",\"列表包含(或)\",\"空值\",\"非空值\",\"非纯数字\"],\"value\":\"\"},\"filterValue\":{\"label\":\"值\",\"dataType\":\"String\",\"inputType\":\"Select\"},\"fields2\":{\"label\":\"过滤字段2\",\"dataType\":\"List\",\"inputType\":\"Select\",\"source\":\"getFields\"}}"),
    FIELD_VALUE_MAPPING("/statistics/filterValueMapping", "字段值映射", "{\"name\":{\"dataType\":\"String\",\"inputType\":\"Input\",\"label\":\"名称\",\"value\":\"字段值映射\"},\"sourceField\":{\"dataType\":\"List\",\"inputType\":\"Select\",\"label\":\"原始字段\",\"value\":\"\",\"source\":\"getFields\"},\"filterValues\":{\"dataType\":\"List\",\"inputType\":\"Select\",\"label\":\"映射值\",\"value\":\"\",\"source\":\"getFields\"},\"mappingType\":{\"dataType\":\"String\",\"inputType\":\"Select\",\"label\":\"映射类型\",\"dataEnumFixed\":\"true\",\"dataEnum\":[\"追加\",\"覆盖\"],\"value\":\"追加\"},\"filterFunction\":{\"label\":\"方法\",\"dataType\":\"String\",\"inputType\":\"Select\",\"dataEnumFixed\":\"true\",\"dataEnum\":[\"大于\",\"小于\",\"等于\",\"大于等于\",\"小于等于\",\"包含\",\"不包含\",\"列表包含(或)\",\"空值\",\"非空值\",\"非纯数字\",\"以值为开始\",\"以值为结束\"],\"value\":\"\"},\"targetValues\":{\"dataType\":\"List\",\"inputType\":\"Select\",\"label\":\"目标值\",\"value\":\"\"},\"targetField\":{\"dataType\":\"List\",\"inputType\":\"Select\",\"label\":\"目标字段\",\"value\":\"\",\"source\":\"getFields\"}}"),
    FUNCTION("/statistics/function", "函数", "{\"name\":{\"label\":\"名称\",\"dataType\":\"String\",\"inputType\":\"Input\"},\"function\":{\"label\":\"方法\",\"dataType\":\"String\",\"inputType\":\"Select\",\"dataEnumFixed\":\"true\",\"dataEnum\":[\"计数\"],\"value\":\"计数\"}}"),
    CLEAN("/statistics/clean", "清洗", "{\"name\":{\"label\":\"名称\",\"dataType\":\"String\",\"inputType\":\"Input\"},\"fields\":{\"label\":\"过滤字段\",\"dataType\":\"List\",\"inputType\":\"Select\",\"source\":\"getFields\"},\"filterFunction\":{\"label\":\"过滤方法\",\"dataType\":\"String\",\"inputType\":\"Select\",\"dataEnumFixed\":\"true\",\"dataEnum\":[\"大于\",\"小于\",\"等于\",\"大于等于\",\"小于等于\",\"包含\",\"不包含\",\"列表包含(或)\",\"空值\",\"非空值\",\"非纯数字\"],\"value\":\"\"},\"filterValue\":{\"label\":\"值\",\"dataType\":\"String\",\"inputType\":\"Input\"},\"fields2\":{\"label\":\"过滤字段2\",\"dataType\":\"List\",\"inputType\":\"Select\",\"source\":\"getFields\"}}"),
    GROUP("/statistics/group", "分类汇总", "{\"name\":{\"label\":\"名称\",\"dataType\":\"String\",\"inputType\":\"Input\"},\"groupFields\":{\"label\":\"分组字段\",\"dataType\":\"List\",\"inputType\":\"Select\",\"source\":\"getFields\"},\"statisticsFields\":{\"label\":\"统计字段\",\"dataType\":\"List\",\"inputType\":\"Select\",\"source\":\"getFields\"},\"statisticsMethod\":{\"label\":\"聚合方法\",\"dataType\":\"String\",\"inputType\":\"Select\",\"dataEnumFixed\":\"true\",\"dataEnum\":[\"平均值\",\"计数\",\"求和\",\"合并\"]}}"),

    PERSIST_DATA("persistData", "持久化数据", "{\"name\":{\"label\":\"名称\",\"dataType\":\"String\",\"inputType\":\"Input\"},\"nodeHandler\":{\"dataType\":\"String\",\"dataEnum\":[\"持久化数据\"],\"inputType\":\"Select\",\"label\":\"节点类型\",\"hidden\":\"true\",\"value\":\"持久化数据\"}}"),

    READ_PERSIST_DATA("readPersistData", "读取持久化数据", "{\"name\":{\"label\":\"名称\",\"dataType\":\"String\",\"inputType\":\"Input\"},\"code\":{\"label\":\"编码\",\"dataType\":\"String\",\"inputType\":\"Select\"},\"nodeHandler\":{\"dataType\":\"String\",\"dataEnum\":[\"读取持久化数据\"],\"inputType\":\"Select\",\"label\":\"节点类型\",\"hidden\":\"true\",\"value\":\"读取持久化数据\"}}"),
    CREATE_TABLE("createTable", "输出表", "{\"name\":{\"dataType\":\"String\",\"inputType\":\"Input\",\"label\":\"名称\",\"value\":\"输出表\"},\"dbCode\":{\"dataType\":\"String\",\"inputType\":\"Input\",\"label\":\"数据库标识\",\"value\":\"172.16.137.24_supervise_platform\"},\"tableName\":{\"dataType\":\"String\",\"inputType\":\"Input\",\"label\":\"表名\",\"value\":\"\"},\"uniqueColumns\":{\"label\":\"唯一标识\",\"dataType\":\"List\",\"inputType\":\"Select\",\"source\":\"getFields\"},\"nodeHandler\":{\"dataType\":\"String\",\"dataEnum\":[\"输出表\"],\"hidden\":\"true\",\"inputType\":\"Select\",\"label\":\"节点类型\",\"value\":\"输出表\"}}"),
    SQL_QUERY("/sql/query", "SQL查询", "{\"name\":{\"dataType\":\"String\",\"inputType\":\"Input\",\"label\":\"名称\",\"value\":\"SQL查询\"},\"dbCode\":{\"dataEnum\":[],\"dataType\":\"String\",\"inputType\":\"Select\",\"label\":\"数据库标识\",\"value\":\"\"},\"sql\":{\"dataType\":\"String\",\"inputType\":\"TextArea\",\"label\":\"SQL\",\"value\":\"\"},\"nodeHandler\":{\"dataType\":\"String\",\"dataEnum\":[\"SQL查询\"],\"inputType\":\"Select\",\"label\":\"节点类型\",\"hidden\":\"true\",\"value\":\"SQL查询\"}}"),
    JSON_HANDLE("jsonHandle", "JSON处理", "{\"name\":{\"dataType\":\"String\",\"inputType\":\"Input\",\"label\":\"名称\",\"value\":\"JSON处理\"},\"jsonValue\":{\"dataType\":\"String\",\"inputType\":\"TextArea\",\"label\":\"JSON\",\"value\":\"\"},\"description\":{\"dataType\":\"String\",\"inputType\":\"TextArea\",\"label\":\"描述\",\"value\":\"[name]:名称\\n用于指定json处理器,singleConditionMapping表示单条件映射,可以把符合条件的字段映射为指定值\\n[conditions]:条件数组\\n数组数据项:\\n[operation]:比较操作符\\n包含gt、lt、startsWith、endswith、contains\\n[sourceField]:原字段\\n数据集用于比较的字段名\\n[sourceValue]:比较值\\n用于和字段值比较的固定值\\n[targetField]:映射字段\\n映射的目标字段\\n[targetValue]:映射值\\n映射的目标值\"}}"),
    DATA_SOURCE("dataSource", "数据源", ""),
    RULE_HANDLE("/rule/handle", "规则处理", ""),
    DATA_TYPE("dataType", "数据资源", "{\"name\":{\"dataType\":\"String\",\"inputType\":\"Input\",\"label\":\"名称\",\"value\":\"数据资源\"},\"dbCode\":{\"dataEnum\":[],\"dataType\":\"String\",\"inputType\":\"Input\",\"label\":\"数据库标识\",\"value\":\"\"},\"targetTable\":{\"dataEnum\":[],\"dataType\":\"String\",\"inputType\":\"Input\",\"label\":\"表名\",\"value\":\"\"},\"nodeHandler\":{\"dataType\":\"String\",\"dataEnum\":[\"数据资源\"],\"inputType\":\"Select\",\"label\":\"节点类型\",\"hidden\":\"true\",\"value\":\"数据资源\"}}"),
    KS_FLOW_GRAPH_CHILD_GROUP_BY("ksFlowGraphChildGroupBy", "分组子流程", "{\"name\":{\"dataType\":\"String\",\"inputType\":\"Input\",\"label\":\"名称\",\"value\":\"数据资源\"},\"id\":{\"label\":\"子流程\",\"dataType\":\"List\",\"inputType\":\"Select\"},\"groupFields\":{\"label\":\"分组字段\",\"dataType\":\"List\",\"inputType\":\"Select\",\"source\":\"getFields\"},\"nodeHandler\":{\"dataType\":\"String\",\"dataEnum\":[\"分组子流程\"],\"inputType\":\"Select\",\"label\":\"节点类型\",\"hidden\":\"true\",\"value\":\"分组子流程\"}}"),
    KS_FLOW_GRAPH_CHILD("ksFlowGraphChild", "子流程", ""),

    RULE_INVOKE("/rule/handle", "规则引用", "{\"name\":{\"dataType\":\"String\",\"inputType\":\"Input\",\"label\":\"名称\",\"value\":\"规则引用\"},\"ruleIdList\":{\"dataType\":\"List\",\"inputType\":\"Select\",\"label\":\"规则\",\"value\":\"\"},\"pushClueAutoResultFlag\":{\"dataType\":\"String\",\"dataEnumFixed\":\"true\",\"dataEnum\":[\"是\",\"否\"],\"inputType\":\"Select\",\"label\":\"推送线索\",\"value\":\"是\"},\"nodeHandler\":{\"dataType\":\"String\",\"dataEnum\":[\"规则引用\"],\"inputType\":\"Select\",\"label\":\"节点类型\",\"value\":\"规则引用\"}}"),
    PUSH_CLUE("pushClue", "推送线索", "{\"name\":{\"label\":\"名称\",\"dataType\":\"String\",\"inputType\":\"Input\"},\"rFields\":{\"label\":\"人员权限字段\",\"dataType\":\"List\",\"inputType\":\"Select\"},\"jFields\":{\"label\":\"角色权限字段\",\"dataType\":\"List\",\"inputType\":\"Select\"},\"bFields\":{\"label\":\"部门权限字段\",\"dataType\":\"List\",\"inputType\":\"Select\"},\"nodeHandler\":{\"dataType\":\"String\",\"dataEnum\":[\"推送线索\"],\"inputType\":\"Select\",\"label\":\"节点类型\",\"hidden\":\"true\",\"value\":\"推送线索\"}}"),

    CREATE_TABLE_PUSH_CLUE("createTablePushClue", "业务线索推送", "{\"name\":{\"dataType\":\"String\",\"inputType\":\"Input\",\"label\":\"名称\",\"value\":\"业务线索推送\"},\"dbCode\":{\"dataEnum\":[],\"dataType\":\"String\",\"inputType\":\"Select\",\"label\":\"数据库标识\",\"value\":\"\"},\"uniqueColumns\":{\"label\":\"唯一标识\",\"dataType\":\"List\",\"inputType\":\"Select\",\"source\":\"getFields\"},\"sceneConfig\":{\"dataEnum\":[],\"dataType\":\"String\",\"inputType\":\"Select\",\"label\":\"场景配置\",\"value\":\"\"},\"rFields\":{\"label\":\"人员权限字段\",\"dataType\":\"List\",\"inputType\":\"Select\",\"source\":\"getFields\"},\"jFields\":{\"label\":\"角色权限字段\",\"dataType\":\"List\",\"inputType\":\"Select\",\"source\":\"getFields\"},\"bFields\":{\"label\":\"部门权限字段\",\"dataType\":\"List\",\"inputType\":\"Select\",\"source\":\"getFields\"},\"nodeHandler\":{\"dataType\":\"String\",\"dataEnum\":[\"业务线索推送\"],\"hidden\":\"true\",\"inputType\":\"Select\",\"label\":\"节点类型\",\"value\":\"业务线索推送\"}}");
//    KS_RULE("ksRule", "模型",""),
//    KS_FLOW_GRAPH_CHILD("ksFlowGraphChild", "子流程",""),
//    SPARK_NODE("sparkNode", "操作",""),
//    END("end", "结束","");

    private final String code;
    private final String nodeName;
    private final String nodeTemplate;

    SparkNodeEnum(String code, String nodeName, String nodeTemplate) {
        this.code = code;
        this.nodeName = nodeName;
        this.nodeTemplate = nodeTemplate;
    }

    public static SparkNodeEnum getSparkNodeByCode(String code) {
        for (SparkNodeEnum e : SparkNodeEnum.values()) {
            if (e.getCode().equals(code)) {
                return e;
            }
        }
        return null;
    }

    public static SparkNodeEnum getSparkNodeByNodeName(String name) {
        for (SparkNodeEnum e : SparkNodeEnum.values()) {
            if (e.getNodeName().equals(name)) {
                return e;
            }
        }
        return SparkNodeEnum.DEFAULT;
    }

}
